import jsonData from "@/assets/data/topo-data.json";
// 在Vue文件之外
import { LocalStorage } from "quasar";
import { detailDesigner } from "@/services/index.js";

export const loadDefaultTopoData = (ctx, shopNumber) => {
  // let topoData = LocalStorage.getItem("topoData_" + ctx.state.shopNumber);
  detailDesigner(shopNumber).then(res => {
    let topoData = null;
    // debugger;
    if (res.code == 200 && res.data) {
      topoData = JSON.parse(res.data.json);
    }
    ctx.state.topoData =
      topoData == null || JSON.stringify(topoData) == "{}"
        ? jsonData
        : topoData;
  });
};
